package com.chushouya.common.enums;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 支付通道
 */
public enum PaymentChannelEnum implements IEnum<String> {

    alipay("alipay", "支付宝支付"),
    wxpay("wxpay","微信支付"),
    huabei("huabei","花呗"),
    zhima("zhima","芝麻分期"),
    bank("bank","银行卡"),
    credit("credit","信用卡");

    private String value;

    private String desc;

    PaymentChannelEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(String value) {
        for (PaymentChannelEnum thisEnum : PaymentChannelEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public String value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
